package org.example.cloudprviderpayment8001.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Order(1)
public class DataMethodAspect {
    // AdminServiceImp 下面所有的方法
    // "execution( public * com.atguigu.gulimall.product.controller.CouponController.*(..))"
    @Pointcut("execution(* org.example.cloudprviderpayment8001.service.imp.AdminServiceImp.*(..))")
    public void pointcut(){};

    @Before("pointcut()")
    public void doBefore(){

        System.out.println("method切面方法");
    }

    @Around("pointcut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        // System.out.println("DataMethodAspect+方法");
        return joinPoint.proceed();
    }

}
